<?php

/**
 * This is the model metadata class for table "website".
 */
class WebsiteMetadata extends CARMDC
{
	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'website';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('name', 'required'),
			array('worker_id, is_open', 'numerical', 'integerOnly'=>true),
			array('name', 'length', 'max'=>20),
			array('thumb, logo, desc', 'length', 'max'=>255),
			array('template, host, status', 'length', 'max'=>50),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('id, worker_id, name, is_open, thumb, logo, template, host, status, desc', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'id' => 'ID',
			'worker_id' => '所属用户',
			'name' => '网站名称',
			'is_open' => '是否开通网站',
			'thumb' => '缩略图',
			'logo' => '网站Logo',
			'template' => '网站模板',
			'host' => '域名',
			'status' => '状态',
			'desc' => 'Desc',
		);
	}
}